package com.usian.admin.feign;

import com.usian.model.admin.dtos.NewsAuthDto;
import com.usian.model.common.dtos.PageResponseResult;
import com.usian.model.common.dtos.ResponseResult;
import com.usian.model.media.pojos.WmNews;
import com.usian.model.media.pojos.WmUser;
import com.usian.model.media.vo.WmNewsVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("leadnews-wemedia")
public interface WemediaFeign {
    /**
     * 根据ID 查询文章信息
     * @param id
     * @return
     */
    @GetMapping("/api/v1/news/findOne/{id}")
    public WmNews findById(@PathVariable("id") Integer id);

    /**
     * 修改文章状态
     * @param wmNews
     * @return
     */
    @PostMapping("/api/v1/news/update")
    ResponseResult updateWmNews(WmNews wmNews);

    /**
     * 根据用户Id 查询自媒体用户信息
     * @param id
     * @return
     */
    @GetMapping("/api/v1/user/findOne/{id}")
    WmUser findWmUserById(@PathVariable("id") Integer id);


    @GetMapping("/api/v1/news/findRelease")
    public List<Integer> findRelease();
    /**
     *
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/news/findList")
    public PageResponseResult findList(@RequestBody NewsAuthDto dto);

    /**
     *
     * @param id 文章Id
     * @return
     */
    @GetMapping("/api/v1/news/find_news_vo/{id}")
    public WmNewsVo findWmNewsVo(@PathVariable("id") Integer id);
}
